unit Unit1;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, StdCtrls, SMILESParser, Grids;

type
  TForm1 = class(TForm)
    Button1: TButton;
    StringGrid1: TStringGrid;
    Edit1: TEdit;
    Label1: TLabel;
    procedure Button1Click(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Form1: TForm1;

implementation

{$R *.dfm}

procedure TForm1.Button1Click(Sender: TObject);
var n: Integer;
    Adj: Adjacency;
    i,j:Integer;
begin

  for i:=1 to StringGrid1.ColCount do
    for j:=1 to StringGrid1.ColCount do
    begin
      StringGrid1.Cells[i,j] := '0';
    end;

  SMILES_in_Adj(Edit1.Text, Adj, n);
  StringGrid1.ColCount := n+1;
  StringGrid1.RowCount := n+1;

  for i:=1 to n do
    for j:=1 to n do
    begin
      StringGrid1.Cells[i,j] := IntToStr(Adj[i,j]);
    end

end;

end.
